import {Iaction} from '../../utils/interface';

const initialState = {
    filterCategory:[]
}

const reducer = (state:any,action:Iaction)=>{
    switch(action.type){
        case 'INIT_SEARCH' :
            return {...state,...action.payload}
        case 'DEL_HISTORY' :
            return {...state,...action.payload}
        case 'GET_SEARCH' :
            return {...state,...action.payload}
        case 'CANCEL_SEARCH' :
            return {...state,goodsList:[]}
        default :
            return state
    }
}

export default (state=initialState,action:Iaction)=>reducer(state,action)